package com.hziee.mail.service;

import com.hziee.mail.dao.AddressRepository;
import com.hziee.mail.model.AddressInfoEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author ZX
 */
@Service
public class AddressService {

    @Autowired
    private AddressRepository addressRepository;

    public List<AddressInfoEntity> showAddress(Integer userId) {
        List<AddressInfoEntity> list = addressRepository.findAllByUserIdOrderByDefaultAddressDesc(userId);
        return list;
    }
}
